package cn.lg.soar.boot.client.service;

import cn.lg.soar.boot.client.entity.ClientUser;
import cn.lg.soar.boot.client.entity.vo.ClientUserVo;
import cn.lg.soar.boot.fc.entity.Contract;
import cn.lg.soar.boot.fc.entity.FormItem;
import cn.lg.soar.boot.fc.entity.vo.HousingRecordVo;
import cn.lg.soar.boot.fc.entity.vo.RepairSubmitVo;
import cn.lg.soar.boot.fc.entity.vo.RepairVo;
import cn.lg.soar.boot.fc.entity.vo.TenancyRoomVo;
import cn.lg.soar.common.model.HttpResult;
import cn.lg.soar.common.model.PageQuery;
import cn.lg.soar.common.model.PageResult;
import cn.lg.soar.database.base.service.IBaseService;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 用户信息表
 * @author ZhuanZ（无密码）
 * @since 2025-02-13
 * 开源项目：https://gitee.com/lgx1992/lg-soar 求star！请给我star！请帮我点个star！
 */
public interface ClientApiService extends IBaseService<ClientUser> {

    /**
     * 用户登录
     * @param account
     * @param password
     */
    @Transactional
    public HttpResult<Object> signin(String account, String password);

    /**
     * 获取用户信息
     * @param token
     */
    @Transactional
    public HttpResult<ClientUserVo> userInfo(String token);

    /**
     * 获取我的房源
     */
    @Transactional
    public HttpResult<PageResult<TenancyRoomVo>> housingList(PageQuery pageQuery, String token, Integer housingType);

    /**
     * 房源详情
     */
    @Transactional
    public HttpResult<TenancyRoomVo> tenancyRoomInfo(Long tenancyRoomId);

    /**
     * 获取表单
     */
    @Transactional
    public HttpResult<List<FormItem>> formItem(Integer visibleRange);

    /**
     * 申请租房
     */
    @Transactional
    public HttpResult<Void> applyRoom(String token,Long applicantId,Long collectId,Long roomId,String processData);

    /**
     * 用户房源记录
     */
    @Transactional
    public HttpResult<PageResult<HousingRecordVo>> housingRecord(PageQuery pageQuery, String token);

    /**
     * 续租申请
     */
    @Transactional
    public HttpResult<Void> continueApply(String token,Long tenancyId);

    /**
     * 用户续租记录
     */
    @Transactional
    public HttpResult<PageResult<HousingRecordVo>> continueRecord(PageQuery pageQuery, String token);

    /**
     * 退租申请
     */
    @Transactional
    public HttpResult<Void> exitTenancyApply(String token,Long tenancyId);

    /**
     * 用户退租记录
     */
    @Transactional
    public HttpResult<PageResult<HousingRecordVo>> exitTenancyRecord(PageQuery pageQuery, String token);

    /**
     * 用户申请报修
     */
    @Transactional
    public HttpResult<Void> repair(String token, RepairSubmitVo repairSubmit);


    /**
     * 用户报修记录
     */
    @Transactional
    public HttpResult<PageResult<RepairVo>> repairRecord(PageQuery pageQuery, String token);

    /**
     * 待签合同详情
     */
    @Transactional
    public HttpResult<Contract> contractInfo(String token, Long tenancyRoomId);

    /**
     * 合同签订
     */
    @Transactional
    public HttpResult<Void> contractSign(String token,Long contractId,String signUrl);

    /**
     * 用户提交基础信息表单
     */
    @Transactional
    public HttpResult<Void> applyApplicant(String token,Long collectId,Long formResultId,String name,
                                           String phone,Integer userLink,String processData);

    /**
     * 刷新token
     * @param token
     */
    @Transactional
    public HttpResult<Object> refreshToken(String token);
}
